<?php
class Item_type_model extends CI_Model{
	function __construct(){
		parent::__construct();
	}
	
	public function get_all(){
		$query = $this->db->get('item_type');
		return $query->result();
	}

	public function get_id($type_name){
		$query = $this->db->get_where('item_type', array('item_type_name' => $type_name));
		if ($query->num_rows() > 0)
		{
			$row = $query->row();
			return $row->item_type_id;
		}else 
			return -1;
	}
}